﻿Public Class AlarmJob
    Implements Quartz.IJob

    Public Sub Execute(context As Quartz.IJobExecutionContext) Implements Quartz.IJob.Execute
        Dim instance As MainWindow
        Dim disp As System.Windows.Threading.Dispatcher

        instance = DirectCast(context.JobDetail.JobDataMap("Instance"), MainWindow)
        disp = DirectCast(context.JobDetail.JobDataMap("Dispatcher"), System.Windows.Threading.Dispatcher)

        disp.BeginInvoke(Sub() instance.PlayAlarm())

    End Sub

End Class